home *** CD-ROM | disk | FTP | other *** search
/ Amiga Game-Power / Amiga Game-Power.iso / pd mix ii / access / hddriver / support / park.c < prev    next >
C/C++ Source or Header  |  1994-05-20  |  699b  |  37 lines

  1.  
  2. /* assumes 32 bit ints */
  3.  
  4. #include "harddisk.h"
  5.  
  6.  
  7. extern struct MsgPort *CreatePort();
  8. extern struct IOStdReq *CreateExtIO();
  9.  
  10. main ()
  11. {
  12.     struct IOExtHD *req;
  13.     struct MsgPort *port;
  14.     int status;
  15.  
  16.  
  17.     port = CreatePort ( 0 , 0 );
  18.     if ( port != NULL ) {
  19.         req = (struct IOExtHD *)
  20.             CreateExtIO ( port , sizeof ( struct IOExtHD ) );
  21.         if ( req != NULL ) {
  22.             if ( OpenDevice ( HD_NAME , 0 , req , 0 ) == 0 ) {
  23.                 req->iohd_TD.iotd_Req.io_Command = HD_PARK;
  24.                 if ( DoIO ( req ) == 0 ) {
  25.                     printf ( "Park complete\n" );
  26.                 }
  27.                 else {
  28.                     printf ( "Park failed\n" );
  29.                 }
  30.                 CloseDevice ( req );
  31.             }
  32.             DeleteExtIO ( req , sizeof ( struct IOExtHD ) );
  33.         }
  34.         DeletePort ( port );
  35.     }
  36. }
  37.